package example.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.web.bind.WebDataBinder;

import java.text.SimpleDateFormat;
import java.util.Date;

public class BaseController {
    private Logger logger = Logger.getLogger(BaseController.class);

    public void initBinder(WebDataBinder dataBinder) {
        logger.info("进入BaseController的initBinder方法");
        dataBinder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), true));

    }
}
